package org.shj.book1.ioblock;

import java.io.IOException;
import java.util.Map;
import java.util.concurrent.ExecutionException;

public class SequentialCal extends AbstractCalTotal{

	@Override
	public double computeNetAssetValue(Map<String, Integer> stocks)throws IOException {
		double values = 0.0;
		for(String ticker : stocks.keySet()){
			values += stocks.get(ticker)* YahooFinance.getPrice(ticker);
		}
		return values;
	}

	public static void main(String[] args)throws ExecutionException, InterruptedException, IOException{
		new SequentialCal().timeAndComputeValue();
	}
}
